﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="TorontoPictureDetail.aspx.vb" Inherits="DusanProject.TorontoPictureDetail" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="dj" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class="detailClass">
    <br />

    <asp:Label ID="lblTorontoPictureName" CssClass="lblTorontoPictureName" runat="server"></asp:Label>

    <br /><br/>

    <dj:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"/>
    <dj:Rating ID="Rating1" AutoPostBack="true" OnChanged="OnRatingChanged" runat="server"
    StarCssClass="starEmpty" WaitingStarCssClass="starWait" EmptyStarCssClass="starEmpty"
    FilledStarCssClass="starFill">
    </dj:Rating>
    <br /><br/>
    <asp:Label ID="lblRatingStatus" runat="server" Text=""/>
    <br /><br/>

    <asp:LinkButton ID="btn_Like" runat="server">Like</asp:LinkButton>
    <asp:Label ID="lbl_Like" runat="server" Text="You likes it"></asp:Label>
    <br /><br />
        <asp:Label ID="lblTags" runat="server" Text="Label"></asp:Label>
    <br /><br />

    <asp:Label ID="lblPictureOwnerName" CssClass="lblPictureOwner" Text="Picture Owner: " runat="server"></asp:Label> 
    <asp:Label ID="lblPictureOwner" CssClass="lblPictureOwner" runat="server"></asp:Label>

    <br /><br/>

    <asp:Label ID="lblYearTakenName" CssClass="lblYearTaken" Text="Year Taken: " runat="server"></asp:Label>
    <asp:Label ID="lblYearTaken" CssClass="lblYearTaken" runat="server"></asp:Label>

    <br /><br/>

    <asp:Label ID="lblDescriptionName" CssClass="lblDescription" Text="Description: " runat="server"></asp:Label>
    <asp:Label ID="lblDescription" CssClass="lblDescription" runat="server"></asp:Label>

    <br/><br/>

    <asp:Label ID="lblDetailsName" CssClass="lblDetails" Text="Details: " runat="server"></asp:Label>
    <asp:Label ID="lblDetails" CssClass="lblDetails" runat="server"></asp:Label>


    <br />
    <br />
    <asp:CheckBox ID="chk_Active" runat="server" Text="Active"/>&nbsp;<asp:Button ID="btn_Active" runat="server" Text="Save" />
    <br />


    <br />
    <br />
    <div class="center"><asp:Image ID="imgPicture" runat="server" Width="640" Height="480" /></div>

    <br />

  <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyC5-xEzk3dQKhJXwKYVtQSyJwnjbi4HN8s&sensor=false"></script>

   <script>

   var myCenter=<%=getLatLng()%>


function initialize()
{
var mapProp = {
  center:myCenter,
  zoom:5,
  mapTypeId:google.maps.MapTypeId.ROADMAP
  };

var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);

var marker=new google.maps.Marker({
  position:myCenter,
  });

marker.setMap(map);
}

google.maps.event.addDomListener(window, 'load', initialize);
</script>


    <br />
    <br />
    <div id="googleMap" style="width:500px;height:380px;border: 1px #4e667d solid;" class="center"></div>
    
   

    <br />
    

    <br />
    <br />
 
    </div>
      
    <br />
    <div class="center"><h3>Comments</h3></div>
    <br />

    <asp:GridView ID="gv_Comments" CssClass="gv_Comments" runat="server" 
        AllowPaging="True" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1" CellPadding="4" ForeColor="#333333" 
        GridLines="None" Width="800">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                SortExpression="ID" />
            <asp:BoundField DataField="Active" HeaderText="Active" />

            <asp:ButtonField CommandName="ChangeActiveStatus" ButtonType="Link" DataTextField="ButtonText" />
            <asp:BoundField DataField="CommentTitle" HeaderText="Title" 
                SortExpression="CommentTitle" />
            <asp:BoundField DataField="CommentDescription" HeaderText="Description" 
                SortExpression="CommentDescription" />
            <asp:BoundField DataField="UserName" HeaderText="Created By" 
                SortExpression="UserName" />
            <asp:BoundField DataField="DatePosted" HeaderText="Date Posted" 
                SortExpression="DatePosted" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" 
            HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" ForeColor="#333333" Font-Bold="True" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
 

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:dbDusanCS %>" 
        ProviderName="<%$ ConnectionStrings:dbDusanCS.ProviderName %>" 
        SelectCommand="SELECT [ID], [Active], [CommentTitle], [CommentDescription], [UserName], SWITCH(Active=True,'Deactivate',Active=False,'Activate') AS ButtonText, DatePosted FROM [TorontoPicturesCommentsJunctionQuery]">
    </asp:SqlDataSource>

 <br />
 <br />
 <br />
    <div class="center"><h3>Add new Comment</h3></div>
<br />

  <asp:Table ID="tbl_Add" CssClass="addCommentTable" runat="server" CellPadding="5" CellSpacing="5" Width="600">

<asp:TableRow >
    <asp:TableCell VerticalAlign="Middle">
        <asp:Label class="add5" ID="lbl_CommentTitle" runat="server" Text="Title:"></asp:Label> &nbsp;&nbsp;
        <asp:TextBox ID="tb_CommentTitle" runat="server" Width="100"></asp:TextBox>
     </asp:TableCell>
    <asp:TableCell VerticalAlign="Middle">
        <asp:Label class="add5" ID="lbl_CommentDescription" runat="server" Text="Description:"></asp:Label> &nbsp;&nbsp;
        <asp:TextBox ID="tb_CommentDescription" runat="server" Width="400"></asp:TextBox>
    </asp:TableCell> 
    <asp:TableCell VerticalAlign="Middle">
       <asp:Button ValidationGroup="A" ID="btnAddNew" CssClass="slideButton" runat="server" Text="Add New" />
    </asp:TableCell>
</asp:TableRow>
<asp:TableRow >
    <asp:TableCell>
        <asp:RequiredFieldValidator ForeColor="Red" ValidationGroup="A" ID="RequiredFieldValidator1" runat="server" ErrorMessage="CommentTitle is Required" ControlToValidate="tb_CommentTitle"></asp:RequiredFieldValidator>
    </asp:TableCell>
    <asp:TableCell>
        <asp:RequiredFieldValidator ForeColor="Red" ValidationGroup="A" ID="RequiredFieldValidator2" runat="server" ErrorMessage="Description is Required" ControlToValidate="tb_CommentDescription"></asp:RequiredFieldValidator>
    </asp:TableCell>
     <asp:TableCell CssClass="center">
       &nbsp;
    </asp:TableCell>

    </asp:TableRow>

    </asp:Table>

    

     <asp:Table ID="tableTag" CssClass="addTagTable" runat="server" CellPadding="5" CellSpacing="5" Width="600" >
     <asp:TableRow>
     <asp:TableCell>
         <asp:CheckBoxList ID="chkAddTag" runat="server"  DataTextField="TagName" DataValueField="ID" 
            RepeatDirection="Horizontal">
    </asp:CheckBoxList>
     </asp:TableCell>

     </asp:TableRow>
        <asp:TableRow>
     <asp:TableCell>
         <asp:Button CssClass="slideButton" Id="btnAddTags" runat="server" Text="Add Tags to the picture" />
     </asp:TableCell>

     </asp:TableRow>
     </asp:Table>

    


    <br />

      <asp:Table ID="addNewTag" CssClass="addTagTable" runat="server" CellPadding="2" CellSpacing="2" Width="300">

    <asp:TableRow >
    <asp:TableCell VerticalAlign="Middle">
        <asp:TextBox ID="txt_NewTag" runat="server" Width="100"></asp:TextBox>
     </asp:TableCell>
    <asp:TableCell VerticalAlign="Middle">
        <asp:Button ID="btn_AddNewTag" runat="server" Text="Add New Tag" CssClass="slideButton" />
    </asp:TableCell> 
    </asp:TableRow>
    </asp:Table>

    <br />

</asp:Content>
